package com.atguigu.yygh.order.util;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

@Component
public class ConstantWeixinPayUtils implements InitializingBean {
    @Value("${weixin.pay.appid}")
    private String appid;
    @Value("${weixin.pay.partner}")
    private String partner;
    @Value("${weixin.pay.partnerkey}")
    private String partnerkey;
    @Value("${weixin.pay.cert}")
    private String cert;

    public static String APPID;
    public static String PARTNER;
    public static String PARTNERKEY;
    public static String CERT; //退款时才会用到

    @Override
    public void afterPropertiesSet() throws Exception {
        APPID=this.appid;
        PARTNER=this.partner;
        PARTNERKEY=this.partnerkey;
        CERT=this.cert;
    }
}
